//Anime4K v3.2 GLSL

// MIT License

// Copyright (c) 2019-2020 bloc97
// All rights reserved.

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

//!DESC Anime4K-v3.2-Denoise(Heavy)-CNN-(L)-Conv-16x3x3x1-Conv-4x1x1x32
//!HOOK NATIVE
//!BIND HOOKED
//!COMPONENTS 4
//!SAVE LUMAN0
vec4 hook() {
    vec2 dp = HOOKED_pt;
    float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x;
    float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x;
    float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x;
    float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x;
    float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x;
    float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x;
    float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x;
    float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x;
    float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x;
    float t0 = -1.0128342*a + -1.2796544*b + -0.7730753*c + 0.35741436*d + -1.1381667*e + -0.7686257*f + -0.8040978*g + -1.0813837*h + -1.3947179*i + -0.1065035;
    float t1 = 0.3910798*a + -0.8834329*b + -0.20034531*c + 0.5811822*d + -1.1690049*e + -0.38816056*f + -0.5208652*g + 0.110656075*h + -0.17237788*i + -0.09395952;
    float t2 = 0.05244725*a + 0.36583462*b + 0.40215454*c + 0.6379589*d + 0.79298455*e + 0.8213191*f + 0.8404209*g + 0.22149192*h + 0.3202996*i + 0.2523997;
    float t3 = -0.7283716*a + -0.12143967*b + 0.45830318*c + -0.13164425*d + 0.5640704*e + 0.6473527*f + -0.08750403*g + 0.3269256*h + 0.16450663*i + -0.0025674745;
    float t4 = 0.70474714*a + 0.8542352*b + 0.7976562*c + 0.6552911*d + 1.1277622*e + 0.615761*f + 0.021615438*g + -0.053952754*h + 0.54383224*i + 0.0717068;
    float t5 = -0.4040013*a + -0.18043745*b + 0.4716272*c + 0.05496162*d + -1.1274604*e + 0.004653591*f + -0.23034742*g + -0.26518378*h + -0.44565356*i + -0.20101063;
    float t6 = 0.061217327*a + -0.11294959*b + 1.237114*c + -0.44087481*d + -0.17968822*e + 0.5142175*f + 0.22297472*g + 0.36124992*h + 0.1743908*i + -0.30631503;
    float t7 = 0.47952712*a + 0.005336464*b + -0.55501455*c + 0.74148965*d + -0.17215373*e + -0.004995045*f + -0.33964464*g + -0.564168*h + 0.24650766*i + 0.08467817;
    float t8 = 0.19956394*a + -0.4418483*b + -0.3863448*c + 0.17598012*d + 0.63642657*e + -0.6388652*f + 0.42991406*g + -0.28329685*h + 0.18992826*i + -0.11756727;
    float t9 = -0.17128083*a + -0.6045423*b + -0.65940833*c + 0.3570804*d + -0.20153023*e + 0.021003623*f + 0.32306197*g + 0.29084146*h + 0.70109606*i + 0.07221801;
    float t10 = 0.029798958*a + -0.11216204*b + 0.21773997*c + 0.43234816*d + -0.14889498*e + 0.5193834*f + 0.28125113*g + -0.3727567*h + 0.50934905*i + -0.0048279124;
    float t11 = 0.26167467*a + -0.49816233*b + 1.095343*c + 0.10822768*d + 0.34716806*e + 0.82659185*f + 0.27639905*g + 1.1666102*h + 0.36982694*i + 0.22940508;
    float t12 = 0.23617245*a + 1.2047768*b + 0.32073838*c + 0.056030814*d + 0.64883393*e + 0.33799353*f + 0.1752532*g + 0.071314946*h + -0.3313955*i + 0.33926216;
    float t13 = -1.3804979*a + 0.062729314*b + -0.8314607*c + -1.3435825*d + 0.23063318*e + -0.71288157*f + -1.2048184*g + 0.09806158*h + -0.710262*i + -0.54610914;
    float t14 = -0.42145634*a + -0.78853023*b + -1.6439841*c + -0.81803787*d + -0.65694827*e + -0.2639766*f + -1.0387814*g + -0.6506427*h + -0.30731946*i + -0.28270411;
    float t15 = 0.07560567*a + -0.5138095*b + 0.065052114*c + -0.20289713*d + -0.95370984*e + -0.011910215*f + 0.33688363*g + 0.13822433*h + 0.18687278*i + 0.32394204;
	
	
    float nt0 = -min(t0, 0);
    float nt1 = -min(t1, 0);
    float nt2 = -min(t2, 0);
    float nt3 = -min(t3, 0);
    float nt4 = -min(t4, 0);
    float nt5 = -min(t5, 0);
    float nt6 = -min(t6, 0);
    float nt7 = -min(t7, 0);
    float nt8 = -min(t8, 0);
    float nt9 = -min(t9, 0);
    float nt10 = -min(t10, 0);
    float nt11 = -min(t11, 0);
    float nt12 = -min(t12, 0);
    float nt13 = -min(t13, 0);
    float nt14 = -min(t14, 0);
    float nt15 = -min(t15, 0);

    t0 = max(t0, 0);
    t1 = max(t1, 0);
    t2 = max(t2, 0);
    t3 = max(t3, 0);
    t4 = max(t4, 0);
    t5 = max(t5, 0);
    t6 = max(t6, 0);
    t7 = max(t7, 0);
    t8 = max(t8, 0);
    t9 = max(t9, 0);
    t10 = max(t10, 0);
    t11 = max(t11, 0);
    t12 = max(t12, 0);
    t13 = max(t13, 0);
    t14 = max(t14, 0);
    t15 = max(t15, 0);
	
    float s = -1.0942503*t0 + -0.595973*t1 + -0.43409464*t2 + 0.46965072*t3 + 0.22325087*t4 + 0.47213522*t5 + -0.37494528*t6 + 0.016665574*t7 + 0.3635647*t8 + 0.18248281*t9 + -0.1913406*t10 + 0.12483551*t11 + -0.33013025*t12 + 0.78097075*t13 + -1.0148687*t14 + -0.072404355*t15 + -0.29785872*nt0 + 0.079401776*nt1 + 0.3644275*nt2 + -0.8477504*nt3 + -1.30957*nt4 + 0.086023964*nt5 + -0.016239002*nt6 + -0.09172822*nt7 + -0.48549172*nt8 + -0.37054867*nt9 + 0.5952657*nt10 + -0.64712626*nt11 + -0.25773895*nt12 + 0.24869384*nt13 + 0.31022465*nt14 + 0.4005507*nt15 + -0.085999735;
    float t = -1.6599023*t0 + -0.12816662*t1 + -0.7850091*t2 + -1.078079*t3 + 0.31854886*t4 + 1.1660525*t5 + -0.19581404*t6 + -0.2538929*t7 + -0.28573072*t8 + -0.1704394*t9 + 0.17035137*t10 + -0.4809027*t11 + -0.0100107845*t12 + 1.374*t13 + -0.2840433*t14 + 0.90155685*t15 + 0.44641274*nt0 + -0.2045765*nt1 + 1.4513856*nt2 + 0.34627825*nt3 + -0.26566046*nt4 + -0.33126828*nt5 + -0.292994*nt6 + -0.31384474*nt7 + -0.12096911*nt8 + -0.3014572*nt9 + -0.74601793*nt10 + -1.2720426*nt11 + 1.2000507*nt12 + 0.11497255*nt13 + 0.34746364*nt14 + 0.29304495*nt15 + 0.12004558;
    float u = -1.5061814*t0 + 0.34550628*t1 + 0.32309085*t2 + 0.4060594*t3 + -0.0951422*t4 + 1.709691*t5 + 0.04556652*t6 + 0.816543*t7 + -0.10775941*t8 + 0.1833376*t9 + 0.101947844*t10 + -0.3679021*t11 + 0.1933619*t12 + 0.6379347*t13 + -1.7192352*t14 + -0.50402015*t15 + 0.13506958*nt0 + -0.3132308*nt1 + -0.63316005*nt2 + 0.2289355*nt3 + -2.238877*nt4 + -0.29270625*nt5 + -0.18931018*nt6 + -0.23450108*nt7 + 0.43381786*nt8 + -0.28954655*nt9 + 1.2487197*nt10 + -0.3539614*nt11 + -0.98416907*nt12 + 0.14772023*nt13 + -0.1731071*nt14 + -0.425084*nt15 + -0.07319471;
    float v = -0.22626057*t0 + 0.3098053*t1 + 0.64932215*t2 + -0.5476035*t3 + -0.35350052*t4 + 0.20281094*t5 + 0.080141604*t6 + -0.64487165*t7 + -0.06190651*t8 + 0.45465252*t9 + -0.12453859*t10 + -0.35195875*t11 + -0.2552745*t12 + 0.5568378*t13 + -0.2153897*t14 + 0.053290594*t15 + -0.19199294*nt0 + -0.48163447*nt1 + 0.5403749*nt2 + 0.06722908*nt3 + 1.5406651*nt4 + -0.71561116*nt5 + 0.011601474*nt6 + 0.2969521*nt7 + -0.36802652*nt8 + -0.21496966*nt9 + 0.8105416*nt10 + 0.115252376*nt11 + 0.24186856*nt12 + 0.3067076*nt13 + 0.5624502*nt14 + 0.4273298*nt15 + 0.12028708;
    
    return vec4(s, t, u, v);
}
//!DESC Anime4K-v3.2-Denoise(Heavy)-CNN-(L)-Conv-4x3x3x8
//!HOOK NATIVE
//!BIND HOOKED
//!COMPONENTS 4
//!BIND LUMAN0
//!SAVE LUMAN1

#define L_tex LUMAN0_tex

vec4 hook() {
    vec2 dp = HOOKED_pt;

    vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y));
    vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0));
    vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y));
    vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y));
    vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0));
    vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y));
    vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y));
    vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0));
    vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y));

    vec4 na0 = -min(a0, vec4(0));
    vec4 nb0 = -min(b0, vec4(0));
    vec4 nc0 = -min(c0, vec4(0));
    vec4 nd0 = -min(d0, vec4(0));
    vec4 ne0 = -min(e0, vec4(0));
    vec4 nf0 = -min(f0, vec4(0));
    vec4 ng0 = -min(g0, vec4(0));
    vec4 nh0 = -min(h0, vec4(0));
    vec4 ni0 = -min(i0, vec4(0));

    a0 = max(a0, vec4(0));
    b0 = max(b0, vec4(0));
    c0 = max(c0, vec4(0));
    d0 = max(d0, vec4(0));
    e0 = max(e0, vec4(0));
    f0 = max(f0, vec4(0));
    g0 = max(g0, vec4(0));
    h0 = max(h0, vec4(0));
    i0 = max(i0, vec4(0));
    float i = 0.09741168*a0.x + 0.29002434*b0.x + -0.15757771*c0.x + -0.57047343*d0.x + 0.061362505*e0.x + 0.14285076*f0.x + -0.65296113*g0.x + -0.6275021*h0.x + -0.07862797*i0.x;
    float j = -0.036453888*a0.y + 0.021263579*b0.y + 0.1466485*c0.y + -0.0013707286*d0.y + -0.16439883*e0.y + 0.07714189*f0.y + 0.09274446*g0.y + 0.170467*h0.y + 0.16713436*i0.y;
    float k = -0.24011658*a0.z + 0.07092328*b0.z + 0.22825928*c0.z + 0.05860552*d0.z + -0.7149626*e0.z + -0.16768442*f0.z + -0.0041024094*g0.z + -0.3671845*h0.z + 0.04522911*i0.z;
    float l = -0.23230435*a0.w + -0.7476227*b0.w + -0.2649603*c0.w + 0.20404318*d0.w + -0.35199228*e0.w + -0.48173106*f0.w + -0.108718134*g0.w + -0.37133917*h0.w + -0.03853158*i0.w;
    float m = -0.28740543*na0.x + -0.40139154*nb0.x + 0.26754564*nc0.x + 0.23997258*nd0.x + -0.035747897*ne0.x + -0.6041765*nf0.x + 0.1938931*ng0.x + 0.336768*nh0.x + 0.054549128*ni0.x;
    float n = 0.052895874*na0.y + -0.044293273*nb0.y + -0.03374909*nc0.y + 0.118546985*nd0.y + -0.014633943*ne0.y + 0.04594123*nf0.y + 0.094346225*ng0.y + -0.6200723*nh0.y + 0.2678458*ni0.y;
    float o = 0.27887362*na0.z + -0.17563501*nb0.z + -0.28692576*nc0.z + 0.49896336*nd0.z + 0.6344381*ne0.z + 0.19642942*nf0.z + 0.2414018*ng0.z + -0.10174265*nh0.z + 0.027642129*ni0.z;
    float p = -0.033935063*na0.w + 0.528472*nb0.w + 0.034741577*nc0.w + -0.37577125*nd0.w + 0.28952727*ne0.w + 0.18759747*nf0.w + -0.030525722*ng0.w + -0.201465*nh0.w + -0.07946115*ni0.w;
    float o0 = i+j+k+l+m+n+o+p+0.3098867;
    i = 0.093897134*a0.x + 0.22088706*b0.x + -0.046799198*c0.x + 0.1335783*d0.x + -0.12866162*e0.x + -0.05117497*f0.x + 0.30762392*g0.x + 0.5715662*h0.x + -0.17380671*i0.x;
    j = 0.011145031*a0.y + -0.0071403105*b0.y + -0.02058502*c0.y + 0.15178232*d0.y + 0.16203673*e0.y + -0.04393076*f0.y + -0.13374932*g0.y + -0.4464853*h0.y + -0.22353384*i0.y;
    k = -0.07706587*a0.z + -0.25745195*b0.z + -0.25110656*c0.z + -0.3568743*d0.z + -0.23207848*e0.z + 0.047938563*f0.z + 0.09009302*g0.z + 0.19371492*h0.z + -0.046007846*i0.z;
    l = 0.036981*a0.w + -0.10989151*b0.w + -0.14223716*c0.w + -0.05520608*d0.w + -0.23332155*e0.w + -0.091394514*f0.w + 0.062039085*g0.w + 0.11633284*h0.w + 0.09001614*i0.w;
    m = 0.15048656*na0.x + -0.5306974*nb0.x + 0.054532386*nc0.x + 0.25049958*nd0.x + -0.80949515*ne0.x + 0.16314006*nf0.x + 0.5689863*ng0.x + 0.21809822*nh0.x + 0.40732068*ni0.x;
    n = -0.027125143*na0.y + 0.10211949*nb0.y + -0.12241294*nc0.y + 0.44800738*nd0.y + -0.3487349*ne0.y + -0.01568963*nf0.y + -0.48289323*ng0.y + -0.6130645*nh0.y + -0.41479474*ni0.y;
    o = 0.05811621*na0.z + -0.019265544*nb0.z + 0.22046743*nc0.z + -0.0221722*nd0.z + -0.040984195*ne0.z + 0.09766341*nf0.z + -0.28430593*ng0.z + -0.22087033*nh0.z + -0.09230477*ni0.z;
    p = 0.45500106*na0.w + 0.15141925*nb0.w + 0.09211639*nc0.w + 0.28595597*nd0.w + 0.26446697*ne0.w + 0.050844215*nf0.w + 0.03195554*ng0.w + 0.2680976*nh0.w + -0.2069744*ni0.w;
    float p0 = i+j+k+l+m+n+o+p+0.10501868;
    i = -0.031421047*a0.x + 0.1900508*b0.x + 0.044660117*c0.x + -0.011592257*d0.x + 0.3047146*e0.x + 0.21887736*f0.x + -0.26234806*g0.x + 0.9340405*h0.x + 0.5004751*i0.x;
    j = 0.0556624*a0.y + -0.031881228*b0.y + -0.051414974*c0.y + -0.034939464*d0.y + -0.22338922*e0.y + -0.23501489*f0.y + 0.032940395*g0.y + -0.42678648*h0.y + -0.22903545*i0.y;
    k = -0.028505202*a0.z + -0.031597998*b0.z + -0.10567406*c0.z + -0.014338498*d0.z + -0.15967321*e0.z + -0.5068595*f0.z + -0.06862328*g0.z + -0.802087*h0.z + -0.13733897*i0.z;
    l = -0.059017126*a0.w + -0.27857706*b0.w + -0.12816012*c0.w + -0.029605012*d0.w + -0.36180344*e0.w + -0.5969277*f0.w + -0.045720518*g0.w + -0.20729189*h0.w + -0.073229365*i0.w;
    m = 0.014588659*na0.x + -0.17939965*nb0.x + 0.12590672*nc0.x + -0.036811348*nd0.x + -0.17941968*ne0.x + -0.3617346*nf0.x + 0.3018181*ng0.x + -0.9189515*nh0.x + -0.39982805*ni0.x;
    n = -0.093635656*na0.y + 0.07407511*nb0.y + 0.049844734*nc0.y + -0.24742362*nd0.y + -0.23942085*ne0.y + 0.4259658*nf0.y + 0.19647911*ng0.y + 0.7719921*nh0.y + 0.39506462*ni0.y;
    o = -0.20367846*na0.z + 0.060574908*nb0.z + 0.07283706*nc0.z + 0.16116127*nd0.z + 0.35438812*ne0.z + 0.63537276*nf0.z + 0.048945926*ng0.z + 0.75434536*nh0.z + 0.3353933*ni0.z;
    p = -0.03131618*na0.w + 0.47100878*nb0.w + 0.31913784*nc0.w + -0.1686458*nd0.w + 0.09165129*ne0.w + 0.53931856*nf0.w + -0.043087862*ng0.w + 0.25640473*nh0.w + 0.19909622*ni0.w;
    float q0 = i+j+k+l+m+n+o+p+0.8183866;
    i = 0.03130817*a0.x + 0.123628564*b0.x + -0.046002306*c0.x + 0.034987327*d0.x + -0.33991906*e0.x + -0.13561112*f0.x + -0.02510759*g0.x + -0.65944976*h0.x + -0.26493517*i0.x;
    j = -0.038355544*a0.y + 0.26206928*b0.y + -0.11315318*c0.y + 0.07679037*d0.y + 0.29860532*e0.y + 0.007336514*f0.y + 0.0018787665*g0.y + 0.21956116*h0.y + 0.2150852*i0.y;
    k = 0.16838352*a0.z + 0.13397707*b0.z + -0.24124902*c0.z + -0.10387317*d0.z + 0.41938984*e0.z + 0.22963165*f0.z + 0.07832792*g0.z + -0.053749826*h0.z + -0.034759976*i0.z;
    l = -0.035668463*a0.w + 0.028656304*b0.w + -0.013998837*c0.w + 0.05911888*d0.w + -0.37696832*e0.w + 0.09877935*f0.w + -0.08524706*g0.w + -0.081119426*h0.w + 0.10798837*i0.w;
    m = 0.025054354*na0.x + -0.11836696*nb0.x + -0.10642557*nc0.x + -0.08167171*nd0.x + 0.2619927*ne0.x + -0.05639472*nf0.x + 0.16612773*ng0.x + 0.9996083*nh0.x + 0.54383767*ni0.x;
    n = -0.07381711*na0.y + 0.018973246*nb0.y + 0.0864427*nc0.y + 0.049349062*nd0.y + -0.27862266*ne0.y + 0.44432488*nf0.y + -0.06560097*ng0.y + -0.09447208*nh0.y + -0.10789248*ni0.y;
    o = -0.23696414*na0.z + -0.18832983*nb0.z + 0.34482813*nc0.z + -0.01593063*nd0.z + -0.14356539*ne0.z + -0.026607981*nf0.z + 0.13619812*ng0.z + -0.018965296*nh0.z + -0.12390974*ni0.z;
    p = 0.115454376*na0.w + 0.18167189*nb0.w + 0.21773554*nc0.w + 0.062247995*nd0.w + 0.21109772*ne0.w + -0.019852303*nf0.w + -0.064582475*ng0.w + -0.2584724*nh0.w + -0.096874654*ni0.w;
    float r0 = i+j+k+l+m+n+o+p+0.010526568;
    return vec4(o0, p0, q0, r0);
}
//!DESC Anime4K-v3.2-Denoise(Heavy)-CNN-(L)-Conv-4x3x3x8
//!HOOK NATIVE
//!BIND HOOKED
//!COMPONENTS 4
//!BIND LUMAN1
//!SAVE LUMAN2

#define L_tex LUMAN1_tex

vec4 hook() {
    vec2 dp = HOOKED_pt;

    vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y));
    vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0));
    vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y));
    vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y));
    vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0));
    vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y));
    vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y));
    vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0));
    vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y));

    vec4 na0 = -min(a0, vec4(0));
    vec4 nb0 = -min(b0, vec4(0));
    vec4 nc0 = -min(c0, vec4(0));
    vec4 nd0 = -min(d0, vec4(0));
    vec4 ne0 = -min(e0, vec4(0));
    vec4 nf0 = -min(f0, vec4(0));
    vec4 ng0 = -min(g0, vec4(0));
    vec4 nh0 = -min(h0, vec4(0));
    vec4 ni0 = -min(i0, vec4(0));

    a0 = max(a0, vec4(0));
    b0 = max(b0, vec4(0));
    c0 = max(c0, vec4(0));
    d0 = max(d0, vec4(0));
    e0 = max(e0, vec4(0));
    f0 = max(f0, vec4(0));
    g0 = max(g0, vec4(0));
    h0 = max(h0, vec4(0));
    i0 = max(i0, vec4(0));
    float i = -0.026981935*a0.x + -0.34107828*b0.x + -0.0765792*c0.x + -0.08783311*d0.x + -0.24152943*e0.x + 0.13246863*f0.x + 0.15750653*g0.x + 0.44762608*h0.x + 0.25806212*i0.x;
    float j = 0.06454104*a0.y + 0.13132884*b0.y + 0.042537536*c0.y + -0.1360181*d0.y + -0.14159378*e0.y + 0.2536446*f0.y + 0.13339481*g0.y + 0.12538698*h0.y + 0.49421307*i0.y;
    float k = -0.07587254*a0.z + 0.08389107*b0.z + -0.061826732*c0.z + 0.17283124*d0.z + 0.5759504*e0.z + 0.115333416*f0.z + -0.021035641*g0.z + 0.08560224*h0.z + -0.04662452*i0.z;
    float l = -0.0713449*a0.w + -0.18737277*b0.w + 0.12151061*c0.w + -0.106729195*d0.w + -0.27662385*e0.w + -0.0784836*f0.w + -0.35101852*g0.w + -0.46109942*h0.w + 0.02119562*i0.w;
    float m = 0.010812333*na0.x + 0.13187979*nb0.x + 0.025680002*nc0.x + 0.26842237*nd0.x + 0.15321623*ne0.x + -0.05619825*nf0.x + -0.18023874*ng0.x + -0.4395808*nh0.x + 0.07079494*ni0.x;
    float n = -0.3246328*na0.y + -0.10442857*nb0.y + 0.028773041*nc0.y + -0.20683953*nd0.y + -0.14182901*ne0.y + -0.2441853*nf0.y + 0.08441189*ng0.y + -0.011862057*nh0.y + -0.18688954*ni0.y;
    float o = 0.5034828*na0.z + -0.30761057*nb0.z + -0.04909958*nc0.z + -0.30275264*nd0.z + -0.6297389*ne0.z + 0.024693284*nf0.z + -0.030374896*ng0.z + -0.21730962*nh0.z + 0.25727692*ni0.z;
    float p = -0.120204754*na0.w + 0.1172425*nb0.w + -0.0817147*nc0.w + 0.47762966*nd0.w + -0.40011472*ne0.w + -0.08183177*nf0.w + 0.27514747*ng0.w + 0.19000033*nh0.w + -0.38918078*ni0.w;
    float o0 = i+j+k+l+m+n+o+p+-0.25993395;
    i = -0.1531807*a0.x + 0.35009244*b0.x + 0.065791816*c0.x + -0.05398759*d0.x + -0.06534832*e0.x + 0.16633219*f0.x + 0.16950588*g0.x + 0.058732335*h0.x + 0.096567184*i0.x;
    j = 0.061737213*a0.y + 0.14199011*b0.y + 0.07379073*c0.y + -0.17306186*d0.y + -0.157097*e0.y + 0.09487571*f0.y + 0.06388325*g0.y + -0.041855667*h0.y + 0.21090747*i0.y;
    k = -0.105096236*a0.z + -0.24598981*b0.z + -0.0057745045*c0.z + -0.23096211*d0.z + -0.20392366*e0.z + -0.03791223*f0.z + 0.08718766*g0.z + -0.043767303*h0.z + -0.003887808*i0.z;
    l = 0.16846746*a0.w + 0.23897983*b0.w + -0.012356432*c0.w + -0.026610779*d0.w + -0.025834162*e0.w + -0.015796332*f0.w + -0.21284448*g0.w + 0.04282561*h0.w + 0.068726644*i0.w;
    m = 0.17689157*na0.x + -0.05366052*nb0.x + 0.13841408*nc0.x + 0.044501524*nd0.x + 0.085460104*ne0.x + 0.013260533*nf0.x + 0.003217395*ng0.x + -0.121511176*nh0.x + 0.25743857*ni0.x;
    n = -0.15946041*na0.y + -0.13265617*nb0.y + -0.031276494*nc0.y + -0.008150496*nd0.y + 0.07005317*ne0.y + -0.07274558*nf0.y + 0.049515083*ng0.y + 0.016157186*nh0.y + -0.13885477*ni0.y;
    o = 0.0923865*na0.z + 0.15816689*nb0.z + -0.0322943*nc0.z + 0.20611677*nd0.z + 0.18858927*ne0.z + 0.15334947*nf0.z + -0.1034496*ng0.z + -0.13950607*nh0.z + -0.0017581363*ni0.z;
    p = -0.010856905*na0.w + 0.07668058*nb0.w + 0.16476586*nc0.w + 0.21999535*nd0.w + 0.63869935*ne0.w + 0.28846756*nf0.w + 0.013576368*ng0.w + -0.46171302*nh0.w + -0.14970079*ni0.w;
    float p0 = i+j+k+l+m+n+o+p+0.06519224;
    i = 0.018934058*a0.x + -0.5918713*b0.x + -0.5863895*c0.x + -0.21112168*d0.x + -0.10003427*e0.x + -0.0058648004*f0.x + -0.021683695*g0.x + 0.07349042*h0.x + 0.108562164*i0.x;
    j = 0.013290434*a0.y + -0.30254638*b0.y + -0.29663736*c0.y + 0.15388629*d0.y + 0.100623496*e0.y + -0.19435044*f0.y + -0.115516216*g0.y + 0.15321124*h0.y + 0.31706563*i0.y;
    k = 0.0554511*a0.z + -0.092772685*b0.z + 0.06914396*c0.z + 0.034622*d0.z + 0.17445928*e0.z + -0.04907827*f0.z + 0.0282064*g0.z + -0.055178814*h0.z + 0.0154940225*i0.z;
    l = -0.52874935*a0.w + -0.47581175*b0.w + -0.07978804*c0.w + -0.3608692*d0.w + -0.40454584*e0.w + 0.043692116*f0.w + -0.08209705*g0.w + -0.19966957*h0.w + 0.12171373*i0.w;
    m = 0.12993093*na0.x + 0.31164646*nb0.x + -0.20197706*nc0.x + -0.12695126*nd0.x + 0.022946868*ne0.x + 0.0804401*nf0.x + -0.20903951*ng0.x + -0.48010424*nh0.x + 0.037518904*ni0.x;
    n = 0.006952359*na0.y + 0.19587046*nb0.y + 0.2512422*nc0.y + 0.058505833*nd0.y + 0.04165348*ne0.y + -0.29795787*nf0.y + 0.07452474*ng0.y + -0.06638196*nh0.y + 0.09797815*ni0.y;
    o = 0.27854228*na0.z + 0.06165119*nb0.z + -0.2188144*nc0.z + -0.3098181*nd0.z + 0.08035467*ne0.z + -0.02810217*nf0.z + 0.15050201*ng0.z + 0.07429457*nh0.z + 0.12688711*ni0.z;
    p = 0.6798332*na0.w + 0.33636123*nb0.w + -0.0587192*nc0.w + 0.24263008*nd0.w + 0.63121045*ne0.w + -0.6225701*nf0.w + 0.63657224*ng0.w + 0.091911785*nh0.w + -0.35394603*ni0.w;
    float q0 = i+j+k+l+m+n+o+p+0.33226275;
    i = -0.09612061*a0.x + 0.0632971*b0.x + -0.11174989*c0.x + -0.10361525*d0.x + 0.0156008275*e0.x + -0.0511161*f0.x + 0.1059278*g0.x + -0.088345945*h0.x + -0.008594213*i0.x;
    j = 0.13339457*a0.y + 0.021666236*b0.y + -0.03509478*c0.y + -0.022419963*d0.y + 0.23856199*e0.y + 0.024861911*f0.y + -0.10501417*g0.y + -0.08223532*h0.y + 0.21678011*i0.y;
    k = -0.04131085*a0.z + -0.047365557*b0.z + -0.06436861*c0.z + 0.12138744*d0.z + 0.08899932*e0.z + 0.015298799*f0.z + -0.066190064*g0.z + 0.10523964*h0.z + -0.033419743*i0.z;
    l = -0.093897745*a0.w + -0.114399664*b0.w + -0.05304023*c0.w + 0.25580066*d0.w + 0.18833877*e0.w + -0.041931257*f0.w + -0.04079404*g0.w + 0.06606627*h0.w + 0.19474216*i0.w;
    m = 0.2168851*na0.x + 0.41047028*nb0.x + 0.20928073*nc0.x + -0.12862678*nd0.x + -0.18451416*ne0.x + 0.31738204*nf0.x + 0.090644166*ng0.x + -0.13169894*nh0.x + 0.6067428*ni0.x;
    n = -0.15536185*na0.y + -0.104336835*nb0.y + 0.042642683*nc0.y + -0.008931331*nd0.y + -0.5722046*ne0.y + -0.31736642*nf0.y + 0.030574229*ng0.y + -0.13455087*nh0.y + -0.23795237*ni0.y;
    o = -0.24202351*na0.z + 0.08148068*nb0.z + -0.071886376*nc0.z + -0.2217451*nd0.z + -0.02945103*ne0.z + -0.12663773*nf0.z + 0.022972044*ng0.z + -0.21847312*nh0.z + -0.13826017*ni0.z;
    p = 0.42981473*na0.w + 0.570736*nb0.w + 0.14479296*nc0.w + -0.37292355*nd0.w + -0.57586455*ne0.w + 0.37647063*nf0.w + -0.07957879*ng0.w + -0.80672514*nh0.w + -0.40664393*ni0.w;
    float r0 = i+j+k+l+m+n+o+p+-0.22450027;
    return vec4(o0, p0, q0, r0);
}
//!DESC Anime4K-v3.2-Denoise(Heavy)-CNN-(L)-Conv-4x3x3x8
//!HOOK NATIVE
//!BIND HOOKED
//!COMPONENTS 4
//!BIND LUMAN2
//!SAVE LUMAN3

#define L_tex LUMAN2_tex

vec4 hook() {
    vec2 dp = HOOKED_pt;

    vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y));
    vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0));
    vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y));
    vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y));
    vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0));
    vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y));
    vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y));
    vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0));
    vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y));

    vec4 na0 = -min(a0, vec4(0));
    vec4 nb0 = -min(b0, vec4(0));
    vec4 nc0 = -min(c0, vec4(0));
    vec4 nd0 = -min(d0, vec4(0));
    vec4 ne0 = -min(e0, vec4(0));
    vec4 nf0 = -min(f0, vec4(0));
    vec4 ng0 = -min(g0, vec4(0));
    vec4 nh0 = -min(h0, vec4(0));
    vec4 ni0 = -min(i0, vec4(0));

    a0 = max(a0, vec4(0));
    b0 = max(b0, vec4(0));
    c0 = max(c0, vec4(0));
    d0 = max(d0, vec4(0));
    e0 = max(e0, vec4(0));
    f0 = max(f0, vec4(0));
    g0 = max(g0, vec4(0));
    h0 = max(h0, vec4(0));
    i0 = max(i0, vec4(0));
    float i = -0.15632087*a0.x + -0.039758615*b0.x + -0.16766247*c0.x + 0.30747056*d0.x + 0.07463017*e0.x + -0.1437996*f0.x + 0.09350472*g0.x + 0.002131903*h0.x + -0.23069648*i0.x;
    float j = 0.111287236*a0.y + -0.016199797*b0.y + 0.026475957*c0.y + 0.08227056*d0.y + -0.15164192*e0.y + 0.27527592*f0.y + 0.121467054*g0.y + -0.08784104*h0.y + -0.27267766*i0.y;
    float k = 0.08525204*a0.z + 0.056884713*b0.z + 0.09036255*c0.z + -0.0316622*d0.z + -0.5089583*e0.z + -0.052417554*f0.z + 0.1790783*g0.z + -0.36751056*h0.z + -0.024955323*i0.z;
    float l = -0.311587*a0.w + 0.054159276*b0.w + -0.031131612*c0.w + -0.60515165*d0.w + -0.20641059*e0.w + -0.23080519*f0.w + 0.35196435*g0.w + -0.07034391*h0.w + 0.26237312*i0.w;
    float m = 0.01015948*na0.x + -0.28849632*nb0.x + 0.0012003771*nc0.x + -0.060137518*nd0.x + -0.3920524*ne0.x + -0.13843262*nf0.x + 0.08664242*ng0.x + -0.28190285*nh0.x + -0.053400382*ni0.x;
    float n = 0.021246865*na0.y + 0.028208015*nb0.y + -0.10853459*nc0.y + 0.10380167*nd0.y + 0.010982353*ne0.y + 0.20533*nf0.y + -0.25485277*ng0.y + -0.1434721*nh0.y + 0.032393757*ni0.y;
    float o = 0.13071229*na0.z + -0.012200909*nb0.z + -0.06001379*nc0.z + 0.10254165*nd0.z + 0.27247512*ne0.z + -0.25066066*nf0.z + 0.46752378*ng0.z + 0.27764827*nh0.z + 0.08688349*ni0.z;
    float p = 0.20233354*na0.w + 0.16884133*nb0.w + 0.19715682*nc0.w + 0.24625218*nd0.w + 0.17251511*ne0.w + 0.25639552*nf0.w + 0.38395107*ng0.w + 0.057581816*nh0.w + -0.09032764*ni0.w;
    float o0 = i+j+k+l+m+n+o+p+-0.022822453;
    i = 0.02606553*a0.x + 0.13843802*b0.x + 0.35182497*c0.x + -0.055159274*d0.x + -0.11081402*e0.x + 0.29211846*f0.x + -0.027917327*g0.x + -0.1091754*h0.x + 0.1483058*i0.x;
    j = -0.27882424*a0.y + -0.0940725*b0.y + -0.6312959*c0.y + 0.06868927*d0.y + 0.159698*e0.y + -0.23181641*f0.y + -0.20120303*g0.y + 0.012008053*h0.y + -0.042597327*i0.y;
    k = 0.18230258*a0.z + 0.11318228*b0.z + 0.17321879*c0.z + 0.28237614*d0.z + -0.3854015*e0.z + -0.1617942*f0.z + 0.32657465*g0.z + 0.43280208*h0.z + -0.22385617*i0.z;
    l = 0.23325631*a0.w + 0.3166364*b0.w + 0.33911055*c0.w + 0.21203582*d0.w + -0.46303508*e0.w + 0.8157573*f0.w + 0.083261736*g0.w + 0.07251846*h0.w + -0.13653557*i0.w;
    m = -0.086627744*na0.x + 0.16284995*nb0.x + -0.016233372*nc0.x + -0.07746504*nd0.x + -0.06367526*ne0.x + -0.07604125*nf0.x + 0.07754281*ng0.x + 0.019888043*nh0.x + -0.19296625*ni0.x;
    n = -0.13091871*na0.y + -0.17680846*nb0.y + -0.026600404*nc0.y + 0.04254584*nd0.y + -0.052081075*ne0.y + 0.1687223*nf0.y + -0.039212767*ng0.y + -0.26296788*nh0.y + -0.04285189*ni0.y;
    o = -0.016631043*na0.z + 0.32049885*nb0.z + 0.5002816*nc0.z + -0.07202427*nd0.z + 0.19819115*ne0.z + 0.40301058*nf0.z + -0.17289081*ng0.z + -0.28565434*nh0.z + 0.31385276*ni0.z;
    p = -0.23192872*na0.w + -0.10213394*nb0.w + -0.5149782*nc0.w + -0.075347126*nd0.w + 0.39559075*ne0.w + -0.14233613*nf0.w + -0.281008*ng0.w + 0.10099653*nh0.w + -0.21292898*ni0.w;
    float p0 = i+j+k+l+m+n+o+p+-0.21132179;
    i = 0.03958202*a0.x + 0.09092307*b0.x + -0.15163983*c0.x + -0.121576525*d0.x + -0.2156575*e0.x + -0.23159967*f0.x + 0.16147907*g0.x + -0.096346356*h0.x + -0.36340952*i0.x;
    j = -0.16701059*a0.y + 0.195888*b0.y + 0.6795308*c0.y + 0.34496897*d0.y + 0.106202215*e0.y + 0.33909145*f0.y + 0.31873596*g0.y + 0.5364262*h0.y + 0.26774222*i0.y;
    k = 0.4098939*a0.z + -0.20167552*b0.z + -0.01047524*c0.z + 0.39902204*d0.z + -0.5370743*e0.z + -0.112678915*f0.z + 0.06410227*g0.z + -0.020699779*h0.z + 0.2678858*i0.z;
    l = 0.38526234*a0.w + -0.22537166*b0.w + 0.07302496*c0.w + 0.33746564*d0.w + -0.22096705*e0.w + -0.5186882*f0.w + 0.5536755*g0.w + -0.505223*h0.w + -0.13874903*i0.w;
    m = 0.16524637*na0.x + -0.08244584*nb0.x + -0.3419698*nc0.x + 0.10076174*nd0.x + 0.5772046*ne0.x + -0.04952329*nf0.x + 0.11528669*ng0.x + 0.0012216589*nh0.x + -0.07172248*ni0.x;
    n = -0.09793889*na0.y + -0.0077605876*nb0.y + 0.093301594*nc0.y + -0.06647171*nd0.y + -0.46570984*ne0.y + -0.03245811*nf0.y + -0.39222896*ng0.y + -0.33800298*nh0.y + -0.18624185*ni0.y;
    o = 0.09509373*na0.z + 0.070717886*nb0.z + -0.15744923*nc0.z + 0.16225663*nd0.z + 0.14138843*ne0.z + -0.533978*nf0.z + -0.030037364*ng0.z + -0.2052021*nh0.z + -0.40504757*ni0.z;
    p = 0.06536957*na0.w + -0.19953588*nb0.w + 0.06468805*nc0.w + -0.074961446*nd0.w + -0.108127356*ne0.w + 0.10802578*nf0.w + 0.026046896*ng0.w + 0.04439246*nh0.w + 0.25004417*ni0.w;
    float q0 = i+j+k+l+m+n+o+p+0.25377545;
    i = -0.13367517*a0.x + 0.3765252*b0.x + -0.27289873*c0.x + 0.28449044*d0.x + 0.06648171*e0.x + -0.08208021*f0.x + 0.10203216*g0.x + -0.18696506*h0.x + -0.31983197*i0.x;
    j = -0.29840133*a0.y + 0.10703097*b0.y + 0.12664495*c0.y + -0.092536464*d0.y + 0.3236392*e0.y + 0.13592868*f0.y + 0.28160048*g0.y + 0.17453328*h0.y + -0.17570773*i0.y;
    k = 0.025425829*a0.z + 0.2733111*b0.z + 0.08505881*c0.z + 0.038187876*d0.z + -0.031211609*e0.z + 0.00641918*f0.z + -0.20893396*g0.z + -0.3616386*h0.z + -0.051270623*i0.z;
    l = -0.3403396*a0.w + -0.22442025*b0.w + 0.096040435*c0.w + -0.31530297*d0.w + 0.7122415*e0.w + 0.15354724*f0.w + -0.20317753*g0.w + 0.041835815*h0.w + -0.10204545*i0.w;
    m = -0.20707057*na0.x + -0.7222283*nb0.x + -0.25766152*nc0.x + -0.3163606*nd0.x + -0.42280072*ne0.x + 0.0030167613*nf0.x + -0.16603993*ng0.x + -0.12424954*nh0.x + -0.11330356*ni0.x;
    n = 0.023348767*na0.y + 0.064449154*nb0.y + 0.104154125*nc0.y + 0.24355815*nd0.y + -0.1421477*ne0.y + 0.097605094*nf0.y + -0.0604805*ng0.y + -0.021041762*nh0.y + 0.012660744*ni0.y;
    o = 0.20644179*na0.z + -0.0023312485*nb0.z + 0.10882191*nc0.z + -0.067522526*nd0.z + -0.22743271*ne0.z + -0.03778307*nf0.z + 0.1856932*ng0.z + -0.038967803*nh0.z + 0.05950826*ni0.z;
    p = 0.32921296*na0.w + 0.19770916*nb0.w + -0.11183514*nc0.w + -0.058502626*nd0.w + 0.2722334*ne0.w + 0.05119137*nf0.w + -0.075392775*ng0.w + 0.03085374*nh0.w + 0.27166227*ni0.w;
    float r0 = i+j+k+l+m+n+o+p+0.10364522;
    return vec4(o0, p0, q0, r0);
}
//!DESC Anime4K-v3.2-Denoise(Heavy)-CNN-(L)-Conv-4x3x3x8
//!HOOK NATIVE
//!BIND HOOKED
//!COMPONENTS 4
//!BIND LUMAN3
//!SAVE LUMAN4

#define L_tex LUMAN3_tex

vec4 hook() {
    vec2 dp = HOOKED_pt;

    vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y));
    vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0));
    vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y));
    vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y));
    vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0));
    vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y));
    vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y));
    vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0));
    vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y));

    vec4 na0 = -min(a0, vec4(0));
    vec4 nb0 = -min(b0, vec4(0));
    vec4 nc0 = -min(c0, vec4(0));
    vec4 nd0 = -min(d0, vec4(0));
    vec4 ne0 = -min(e0, vec4(0));
    vec4 nf0 = -min(f0, vec4(0));
    vec4 ng0 = -min(g0, vec4(0));
    vec4 nh0 = -min(h0, vec4(0));
    vec4 ni0 = -min(i0, vec4(0));

    a0 = max(a0, vec4(0));
    b0 = max(b0, vec4(0));
    c0 = max(c0, vec4(0));
    d0 = max(d0, vec4(0));
    e0 = max(e0, vec4(0));
    f0 = max(f0, vec4(0));
    g0 = max(g0, vec4(0));
    h0 = max(h0, vec4(0));
    i0 = max(i0, vec4(0));
    float i = 0.080810994*a0.x + -0.21106556*b0.x + 0.03563656*c0.x + 0.09395828*d0.x + 0.16287722*e0.x + 0.05464882*f0.x + 0.2357649*g0.x + 0.11710433*h0.x + 0.16104873*i0.x;
    float j = -0.0467214*a0.y + 0.22818941*b0.y + 0.19321364*c0.y + 0.30760297*d0.y + 0.21823974*e0.y + 0.058233954*f0.y + 0.23801309*g0.y + -0.051935636*h0.y + -0.080713*i0.y;
    float k = 0.31237522*a0.z + 0.25170597*b0.z + 0.10170812*c0.z + 0.3108492*d0.z + 0.252663*e0.z + -0.13725992*f0.z + 0.13551685*g0.z + 0.121725276*h0.z + 0.19376108*i0.z;
    float l = 0.33469164*a0.w + -0.37009534*b0.w + -0.10656542*c0.w + 0.032679807*d0.w + -0.2683541*e0.w + -0.11266921*f0.w + -0.17701116*g0.w + -0.47305316*h0.w + -0.042440627*i0.w;
    float m = 0.05079484*na0.x + 0.19006753*nb0.x + 0.26490647*nc0.x + 0.06066187*nd0.x + -0.017222848*ne0.x + 0.105225734*nf0.x + -0.06551826*ng0.x + -0.22376406*nh0.x + 0.43738243*ni0.x;
    float n = -0.07160525*na0.y + 0.05110006*nb0.y + 0.08434208*nc0.y + -0.13307266*nd0.y + 0.20785742*ne0.y + 0.25468484*nf0.y + -0.15630856*ng0.y + 0.08321136*nh0.y + 0.005707167*ni0.y;
    float o = -0.2011538*na0.z + -0.47135642*nb0.z + 0.10009726*nc0.z + -0.078361444*nd0.z + -0.014796283*ne0.z + 0.21150129*nf0.z + 0.045473974*ng0.z + 0.016318226*nh0.z + 0.028966825*ni0.z;
    float p = -0.56550205*na0.w + 0.09518073*nb0.w + 0.018765971*nc0.w + 0.006421236*nd0.w + 0.34391314*ne0.w + -0.6006282*nf0.w + -0.4222876*ng0.w + -0.29781485*nh0.w + -0.51718044*ni0.w;
    float o0 = i+j+k+l+m+n+o+p+0.37476382;
    i = -0.065914266*a0.x + 0.19584797*b0.x + -0.06874705*c0.x + -0.13192555*d0.x + -0.18457063*e0.x + 0.07155471*f0.x + -0.055793732*g0.x + -0.20797862*h0.x + -0.040068407*i0.x;
    j = -0.13859197*a0.y + 0.13746342*b0.y + 0.19268364*c0.y + -0.19907953*d0.y + -0.5638771*e0.y + 0.18473792*f0.y + -0.002415025*g0.y + -0.39748457*h0.y + -0.13290201*i0.y;
    k = -0.04382471*a0.z + -0.12400802*b0.z + 0.06866804*c0.z + -0.064540766*d0.z + -0.40711725*e0.z + -0.09538944*f0.z + 0.2630085*g0.z + 0.14730608*h0.z + -0.09598332*i0.z;
    l = 0.118435375*a0.w + -0.17858113*b0.w + -0.100138985*c0.w + 0.03178873*d0.w + 0.26428097*e0.w + -0.016878488*f0.w + -0.04946027*g0.w + 0.34430405*h0.w + 0.34692156*i0.w;
    m = 0.19879779*na0.x + -0.033958852*nb0.x + 0.36236686*nc0.x + 0.06595817*nd0.x + 0.066202916*ne0.x + 0.5630913*nf0.x + -0.015560058*ng0.x + 0.23563911*nh0.x + 0.3553887*ni0.x;
    n = 0.22995105*na0.y + 0.077024214*nb0.y + 0.2459981*nc0.y + 0.17630832*nd0.y + 0.5553073*ne0.y + 0.034959354*nf0.y + 0.12344196*ng0.y + 0.111553095*nh0.y + -0.0631844*ni0.y;
    o = -0.06569256*na0.z + -0.103132315*nb0.z + -0.13870406*nc0.z + 0.13549235*nd0.z + 0.055523552*ne0.z + -0.28193188*nf0.z + -0.14630564*ng0.z + -0.01318757*nh0.z + -0.1424681*ni0.z;
    p = 0.03324855*na0.w + 0.14782253*nb0.w + 0.12256669*nc0.w + -0.13298701*nd0.w + -0.5062718*ne0.w + -0.3140612*nf0.w + -0.18209939*ng0.w + -0.29149762*nh0.w + -0.22796589*ni0.w;
    float p0 = i+j+k+l+m+n+o+p+-0.17525265;
    i = -0.23426545*a0.x + -0.040248513*b0.x + -0.08771501*c0.x + 0.2530126*d0.x + 0.4663736*e0.x + -0.26592982*f0.x + 0.49261254*g0.x + 0.3596453*h0.x + 0.070610225*i0.x;
    j = 0.13425834*a0.y + -0.32517612*b0.y + 0.19354087*c0.y + 0.5752345*d0.y + 0.37316775*e0.y + -0.2750036*f0.y + 0.15317263*g0.y + 0.6880913*h0.y + 0.06804068*i0.y;
    k = -0.073221095*a0.z + 0.1447503*b0.z + 0.09128622*c0.z + -0.17214794*d0.z + -0.14985175*e0.z + -0.22411132*f0.z + -0.34902123*g0.z + -0.0041070944*h0.z + 0.03429289*i0.z;
    l = 0.26996228*a0.w + 0.24015225*b0.w + -0.022157839*c0.w + 0.14927736*d0.w + -0.3010031*e0.w + -0.12322567*f0.w + 0.25000814*g0.w + -0.46752623*h0.w + -0.19995259*i0.w;
    m = 0.16440777*na0.x + 0.14029865*nb0.x + 0.19523649*nc0.x + 0.15759459*nd0.x + -0.281376*ne0.x + -0.33072016*nf0.x + -0.11917158*ng0.x + -0.19624127*nh0.x + 0.051640123*ni0.x;
    n = -0.1938653*na0.y + -0.20057997*nb0.y + 0.101512305*nc0.y + -0.27333796*nd0.y + -0.27737498*ne0.y + -0.019774841*nf0.y + -0.27392003*ng0.y + -0.068757854*nh0.y + 0.072921105*ni0.y;
    o = -0.23079787*na0.z + -0.16992483*nb0.z + -0.22269097*nc0.z + -0.199422*nd0.z + -0.27785033*ne0.z + -0.16130301*nf0.z + 0.21058306*ng0.z + -0.0200014*nh0.z + -0.15636483*ni0.z;
    p = -0.556702*na0.w + -0.44552058*nb0.w + 0.094530284*nc0.w + 0.4934684*nd0.w + 0.51425654*ne0.w + 0.15502962*nf0.w + 0.0093153315*ng0.w + 0.1693195*nh0.w + -0.06767607*ni0.w;
    float q0 = i+j+k+l+m+n+o+p+0.061526462;
    i = 0.218992*a0.x + -0.12568112*b0.x + -0.05689578*c0.x + 0.32080078*d0.x + 0.08623814*e0.x + -0.23944445*f0.x + 0.06952633*g0.x + -0.32496998*h0.x + -0.4574217*i0.x;
    j = 0.21946606*a0.y + 0.016560458*b0.y + -0.28154403*c0.y + 0.29635397*d0.y + -0.09681118*e0.y + -0.29869992*f0.y + 0.119788885*g0.y + -0.12466375*h0.y + -0.43210652*i0.y;
    k = 0.0048700687*a0.z + -0.0778062*b0.z + -0.24453712*c0.z + -0.49150205*d0.z + -0.53047884*e0.z + -0.5561163*f0.z + -0.12269343*g0.z + 0.3213965*h0.z + -0.031322245*i0.z;
    l = 0.028094457*a0.w + 0.34577104*b0.w + 0.04796788*c0.w + -0.0709822*d0.w + 0.22909121*e0.w + 0.18572842*f0.w + -0.07579314*g0.w + 0.2384483*h0.w + 0.2979197*i0.w;
    m = -0.013778443*na0.x + 0.06994641*nb0.x + -0.37643316*nc0.x + 0.15174645*nd0.x + 0.7634553*ne0.x + -0.117295824*nf0.x + 0.0841537*ng0.x + 0.58559906*nh0.x + 0.31722948*ni0.x;
    n = -0.101998016*na0.y + -0.20019263*nb0.y + 0.31605315*nc0.y + -0.13736847*nd0.y + -0.035617642*ne0.y + 0.15332243*nf0.y + -0.109743595*ng0.y + 0.11800102*nh0.y + -0.03226867*ni0.y;
    o = -0.0002185015*na0.z + 0.2531274*nb0.z + 0.29325438*nc0.z + 0.29402956*nd0.z + 0.56101465*ne0.z + 0.17083488*nf0.z + 0.040670004*ng0.z + -0.13136846*nh0.z + -0.1730494*ni0.z;
    p = 0.077151515*na0.w + 0.13502601*nb0.w + 0.27747285*nc0.w + 0.55264336*nd0.w + 0.011874073*ne0.w + -0.24354751*nf0.w + 0.35462877*ng0.w + -0.4541119*nh0.w + 0.13772911*ni0.w;
    float r0 = i+j+k+l+m+n+o+p+-0.44161108;
    return vec4(o0, p0, q0, r0);
}
//!DESC Anime4K-v3.2-Denoise(Heavy)-CNN-(L)-Conv-4x3x3x8
//!HOOK NATIVE
//!BIND HOOKED
//!COMPONENTS 4
//!BIND LUMAN4
//!SAVE LUMAN5

#define L_tex LUMAN4_tex

vec4 hook() {
    vec2 dp = HOOKED_pt;

    vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y));
    vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0));
    vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y));
    vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y));
    vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0));
    vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y));
    vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y));
    vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0));
    vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y));

    vec4 na0 = -min(a0, vec4(0));
    vec4 nb0 = -min(b0, vec4(0));
    vec4 nc0 = -min(c0, vec4(0));
    vec4 nd0 = -min(d0, vec4(0));
    vec4 ne0 = -min(e0, vec4(0));
    vec4 nf0 = -min(f0, vec4(0));
    vec4 ng0 = -min(g0, vec4(0));
    vec4 nh0 = -min(h0, vec4(0));
    vec4 ni0 = -min(i0, vec4(0));

    a0 = max(a0, vec4(0));
    b0 = max(b0, vec4(0));
    c0 = max(c0, vec4(0));
    d0 = max(d0, vec4(0));
    e0 = max(e0, vec4(0));
    f0 = max(f0, vec4(0));
    g0 = max(g0, vec4(0));
    h0 = max(h0, vec4(0));
    i0 = max(i0, vec4(0));
    float i = 0.08991643*a0.x + 0.15005246*b0.x + 0.11796487*c0.x + 0.15286738*d0.x + 0.068807185*e0.x + -0.14264853*f0.x + 0.20720936*g0.x + 0.31781405*h0.x + 0.09913846*i0.x;
    float j = -0.17880799*a0.y + -0.19671713*b0.y + -0.028944723*c0.y + -0.22064577*d0.y + -0.32342103*e0.y + -0.19121124*f0.y + 0.04722555*g0.y + -0.2804138*h0.y + 0.078161284*i0.y;
    float k = -0.19552028*a0.z + 0.075460665*b0.z + -0.19640133*c0.z + -0.49238637*d0.z + -0.16735058*e0.z + -0.010834618*f0.z + -0.23552299*g0.z + -0.31253898*h0.z + -0.26861244*i0.z;
    float l = -0.46011132*a0.w + -0.15215737*b0.w + -0.13917726*c0.w + 0.06742708*d0.w + -0.040215567*e0.w + 0.10010258*f0.w + 0.07723608*g0.w + -0.029891642*h0.w + 0.12009705*i0.w;
    float m = 0.06844326*na0.x + -0.15466473*nb0.x + 0.034581915*nc0.x + -0.2534262*nd0.x + -0.6567021*ne0.x + -0.018858377*nf0.x + -0.29836956*ng0.x + -0.44240615*nh0.x + 0.08845262*ni0.x;
    float n = 0.24285068*na0.y + 0.54702455*nb0.y + 0.14552274*nc0.y + 0.04241645*nd0.y + 0.6556346*ne0.y + 0.31463608*nf0.y + 0.11480289*ng0.y + 0.33000982*nh0.y + 0.08715984*ni0.y;
    float o = 0.30235556*na0.z + 0.19479527*nb0.z + -0.039474964*nc0.z + 0.36918166*nd0.z + 0.3358663*ne0.z + 0.08026581*nf0.z + 0.4569246*ng0.z + 0.41827244*nh0.z + 0.01094918*ni0.z;
    float p = -0.014803387*na0.w + -0.22980154*nb0.w + 0.09114131*nc0.w + -0.26210085*nd0.w + 0.02977502*ne0.w + 0.24231605*nf0.w + -0.047100086*ng0.w + -0.0025497598*nh0.w + 0.1437459*ni0.w;
    float o0 = i+j+k+l+m+n+o+p+0.16563377;
    i = -0.114023216*a0.x + 0.061907288*b0.x + -0.10979702*c0.x + 0.025000133*d0.x + -0.2884278*e0.x + -0.13958097*f0.x + -0.10679813*g0.x + 0.091436684*h0.x + 0.17454605*i0.x;
    j = -0.13694966*a0.y + -0.1995818*b0.y + 0.134075*c0.y + -0.15878546*d0.y + -0.14666176*e0.y + -0.101832844*f0.y + 0.06367853*g0.y + -0.34443024*h0.y + 0.011717539*i0.y;
    k = -0.50734246*a0.z + 0.07189809*b0.z + -0.1376625*c0.z + -0.8871036*d0.z + -0.31270295*e0.z + -0.04268956*f0.z + -0.3517391*g0.z + -0.21546307*h0.z + -0.7006091*i0.z;
    l = 0.1386772*a0.w + -0.5835197*b0.w + -0.045925748*c0.w + -0.65998715*d0.w + -0.5365492*e0.w + 0.13031402*f0.w + -0.26274928*g0.w + -0.086665146*h0.w + 0.09210078*i0.w;
    m = 0.32904476*na0.x + -0.1607512*nb0.x + 0.08053579*nc0.x + -0.24579884*nd0.x + -0.38983446*ne0.x + -0.0746403*nf0.x + -0.34334144*ng0.x + -0.014906651*nh0.x + 0.30233142*ni0.x;
    n = 0.298128*na0.y + 0.5257028*nb0.y + -0.1445256*nc0.y + 0.22646043*nd0.y + 0.46389294*ne0.y + -0.20646928*nf0.y + -0.44678906*ng0.y + -0.13272958*nh0.y + -0.0039063483*ni0.y;
    o = 0.32898262*na0.z + -0.254412*nb0.z + -0.062959775*nc0.z + 0.09700154*nd0.z + 0.15059787*ne0.z + -0.0029369623*nf0.z + 0.38967776*ng0.z + 0.29284462*nh0.z + 0.28001103*ni0.z;
    p = 0.35733786*na0.w + 0.08786061*nb0.w + 0.09136438*nc0.w + 0.083793625*nd0.w + 0.05329082*ne0.w + 0.056828793*nf0.w + 0.010960761*ng0.w + -0.018006435*nh0.w + -0.024987962*ni0.w;
    float p0 = i+j+k+l+m+n+o+p+0.28158736;
    i = 0.24238306*a0.x + -0.065184295*b0.x + 0.44472826*c0.x + 0.05651708*d0.x + -0.14408994*e0.x + -0.059128333*f0.x + 0.44135785*g0.x + 0.13376822*h0.x + 0.20959285*i0.x;
    j = 0.26997834*a0.y + 0.60994536*b0.y + 0.44750735*c0.y + 0.124172285*d0.y + 0.47506866*e0.y + 0.16805853*f0.y + 0.51523465*g0.y + -0.08412756*h0.y + -0.36985105*i0.y;
    k = -0.0221377*a0.z + -0.016613578*b0.z + -0.35725048*c0.z + -0.35109103*d0.z + 0.2392824*e0.z + 0.42808884*f0.z + 0.6729484*g0.z + 0.44990513*h0.z + 0.102801055*i0.z;
    l = 0.027909178*a0.w + 0.7127624*b0.w + -0.7180213*c0.w + 0.4914654*d0.w + 0.13897458*e0.w + -0.5003848*f0.w + -0.25316098*g0.w + -0.33268946*h0.w + -0.61753833*i0.w;
    m = -0.7219524*na0.x + -0.33777222*nb0.x + -0.5236895*nc0.x + -0.09177626*nd0.x + 0.96428895*ne0.x + -0.0113521535*nf0.x + 0.34950715*ng0.x + -0.20198882*nh0.x + 0.006944175*ni0.x;
    n = 0.47893772*na0.y + -0.14189574*nb0.y + -0.20098667*nc0.y + -0.6005054*nd0.y + 0.08541696*ne0.y + 0.68353915*nf0.y + -0.32654354*ng0.y + -0.0026405219*nh0.y + -0.05847963*ni0.y;
    o = -0.33798793*na0.z + 0.3678844*nb0.z + -0.7723857*nc0.z + 0.43155926*nd0.z + 0.32135892*ne0.z + -0.37516016*nf0.z + -0.52905*ng0.z + -0.96164757*nh0.z + -0.8712424*ni0.z;
    p = -0.70841384*na0.w + -0.17176828*nb0.w + 0.014199561*nc0.w + -0.7587065*nd0.w + -0.19846861*ne0.w + 0.055355057*nf0.w + -0.48069054*ng0.w + -0.21681376*nh0.w + 0.10760583*ni0.w;
    float q0 = i+j+k+l+m+n+o+p+0.47808975;
    i = -0.09740893*a0.x + 0.27751645*b0.x + 0.023245595*c0.x + -0.26166257*d0.x + -0.012702769*e0.x + -0.08888693*f0.x + 0.32320625*g0.x + 0.07029418*h0.x + -0.2652283*i0.x;
    j = -0.17938197*a0.y + -0.8783621*b0.y + 0.009097566*c0.y + 0.13338326*d0.y + -0.4631424*e0.y + 0.15156831*f0.y + 0.13647188*g0.y + 0.15859568*h0.y + -0.085868925*i0.y;
    k = 0.04205838*a0.z + -0.29110855*b0.z + -0.29151547*c0.z + 0.5122829*d0.z + -0.3422956*e0.z + -0.27674112*f0.z + 0.121888444*g0.z + 0.07908603*h0.z + -0.110037334*i0.z;
    l = 0.5247729*a0.w + 0.3448355*b0.w + -0.19799882*c0.w + 0.6298383*d0.w + 0.20545104*e0.w + -0.005849032*f0.w + -0.19977158*g0.w + -0.3203018*h0.w + -0.049018484*i0.w;
    m = -0.73622763*na0.x + -0.44590166*nb0.x + -0.2241171*nc0.x + 0.12525387*nd0.x + -0.21272896*ne0.x + 0.333159*nf0.x + 0.006036215*ng0.x + 0.036382057*nh0.x + -0.7013173*ni0.x;
    n = 0.23645243*na0.y + -0.24861872*nb0.y + 0.31503224*nc0.y + 0.2753072*nd0.y + 0.060123004*ne0.y + -0.031082628*nf0.y + 0.34968185*ng0.y + 0.51135004*nh0.y + 0.23794869*ni0.y;
    o = -0.08416037*na0.z + 0.13373612*nb0.z + 0.32251*nc0.z + -0.08075059*nd0.z + 0.019189144*ne0.z + -0.039136894*nf0.z + -0.18610626*ng0.z + 0.33509403*nh0.z + 0.28340262*ni0.z;
    p = 0.12967524*na0.w + 0.42258084*nb0.w + -0.061976235*nc0.w + 0.16877055*nd0.w + -0.092645034*ne0.w + -0.6194804*nf0.w + 0.09162081*ng0.w + 0.015496227*nh0.w + -0.1534793*ni0.w;
    float r0 = i+j+k+l+m+n+o+p+-0.070800774;
    return vec4(o0, p0, q0, r0);
}
//!DESC Anime4K-v3.2-Denoise(Heavy)-CNN-(L)-Conv-Reduce
//!HOOK NATIVE
//!BIND HOOKED
//!COMPONENTS 4
//!BIND LUMAN0
//!BIND LUMAN1
//!BIND LUMAN2
//!BIND LUMAN3
//!BIND LUMAN4
//!BIND LUMAN5

vec4 hook() {
    vec4 a = LUMAN0_tex(HOOKED_pos);
    vec4 b = LUMAN1_tex(HOOKED_pos);
    vec4 c = LUMAN2_tex(HOOKED_pos);
    vec4 d = LUMAN3_tex(HOOKED_pos);
    vec4 e = LUMAN4_tex(HOOKED_pos);
    vec4 f = LUMAN5_tex(HOOKED_pos);
    vec4 na = -min(a, vec4(0));
    vec4 nb = -min(b, vec4(0));
    vec4 nc = -min(c, vec4(0));
    vec4 nd = -min(d, vec4(0));
    vec4 ne = -min(e, vec4(0));
    vec4 nf = -min(f, vec4(0));
    a = max(a, vec4(0));
    b = max(b, vec4(0));
    c = max(c, vec4(0));
    d = max(d, vec4(0));
    e = max(e, vec4(0));
    f = max(f, vec4(0));
    float o = -0.09435159*a.x + 0.09081991*a.y + 0.16816233*a.z + 0.14728227*a.w + 0.10000784*na.x + 0.014674008*na.y + -0.13752535*na.z + -0.08828458*na.w + 0.0038588494*b.x + 0.06961669*b.y + 0.15027532*b.z + -0.01914487*b.w + -0.031350534*nb.x + -0.092034675*nb.y + -0.15491991*nb.z + -0.1188485*nb.w + -0.03946322*c.x + 0.11187343*c.y + 0.027793778*c.z + -0.042292103*c.w + 0.06912006*nc.x + -0.12517752*nc.y + -0.019732121*nc.z + 0.04384535*nc.w + -0.009137028*d.x + 0.010548887*d.y + 0.0018490136*d.z + 0.02217183*d.w + 0.028376345*nd.x + -0.02243233*nd.y + 0.013049007*nd.z + -0.02719539*nd.w + -0.0076311044*e.x + 0.031047171*e.y + 0.018862661*e.z + -0.010395154*e.w + 0.04074566*ne.x + -0.03483764*ne.y + -0.011265274*ne.z + 0.0075280746*ne.w + -0.0050522494*f.x + 0.013989493*f.y + -0.0065913876*f.z + 0.0138480365*f.w + -0.019120917*nf.x + 0.0008136707*nf.y + -0.0018455017*nf.z + -0.012974287*nf.w + -0.07801065;
    return vec4(o + HOOKED_tex(HOOKED_pos).x, HOOKED_tex(HOOKED_pos).yzw);
}
